package patternmining.model.graph.bpsl;

import patternmining.model.graph.Edge;
import patternmining.model.graph.java.JavaMethodDefinition;
import patternmining.model.graph.java.JavaPrimitiveTypeAtribute;

public class BpslDefined_In extends BpslPredicate {

    public BpslDefined_In(BpslVariable origin, BpslVariable destination){
        super(origin, destination);
    }

    public static boolean acceptsArguments(BpslVariable firstArg, BpslVariable secondArg){

        if( firstArg instanceof BpslMethod && secondArg instanceof BpslClass )  return true;

        if( firstArg instanceof BpslTypedVariable && secondArg instanceof BpslClass )  return true;

        return false;
    }

    public String toString(){
        return "Defined-in";
    }
    
    @Override
    public boolean match(Edge otherEdge){
        return ( otherEdge instanceof JavaMethodDefinition ) || ( otherEdge instanceof JavaPrimitiveTypeAtribute ) ;
    }
	 
}
 
